<template>

<div>
<!--  <h1>{{xxx}}</h1>
  <el-button @click="hhh">xxxx</el-button>-->
  <el-cascader :props="props"></el-cascader>
</div>

</template>

<script>
let id = 0;
export default {

  data() {
    return {
      props: {
        lazy: true,
        lazyLoad (node, resolve) {
          const { level } = node;
          setTimeout(() => {
            const nodes = Array.from({ length: level + 1 })
                .map(item => ({
                  label: `选项${id}`,
                  value: ++id,
                  leaf: level >= 2
                }));
            // 通过调用resolve将子节点数据返回，通知组件数据加载完成
            resolve(nodes);
          }, 1000);
        }
      }
    }
  },
  methods: {
    selectByParentId(parentId){
      let _this=this;
      _this.http.get('/xiaoming-cars/dict-district/'+parentId).then(function (response) {
      alert(response.data)

      })
    }
    /*hhh() {
      let _this=this;
      this.http.get('xiaoming-order/order/select-list').then(function (response){
        alert(response.data.message+response.data.state);
        _this.$router.push('/product/detail')
        _this.xxx=response.data.message+response.data.state

      })
    },*/

  },
  mounted() {

  }
}
</script>
<style>
.ccc{
  border: 2px solid #0aa1ed
}
</style>